<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>克隆节点</title>
</head>

<body>

  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
  </ul>
  <script>
    const ul = document.querySelector('ul')
    // 不传true就是只克隆标签,不克隆元素
    // const cloneLi = ul.children[0].cloneNode()
    const cloneLi = ul.children[0].cloneNode(true)
    ul.appendChild(cloneLi)
  </script>
</body>

</html>